/**
 * @USER: Administrator
 * @DATE: 2024/9/15 下午4:54
 * @VERSION: 1.0.0
 */
public class LC1475 {
    public int[] finalPrices(int[] prices) {
        int[] res = new int[prices.length];
        for (int i = 0; i < prices.length; i++) {
            res[i] = prices[i];
            for (int j = i + 1; j < prices.length; j++) {
                if (prices[j] < prices[i]) {
                    res[i] -= prices[j];
                }
            }
        }
        return res;
    }
}
